<?php

namespace app\admin\controller;

use app\admin\services\ExcelOrderBakService;
use app\admin\services\NewOrderService;
use app\BaseController;

class NewOrder extends BaseController
{

    protected $middleware = [
        'LogMiddleware'=>['only'=>['in']]
    ];
    /**
     * 接收订单api
     * @return \think\response\Json
     */
    public function in()
    {
        $p = $this->request->post();
        $p['log_id']=$this->request->log_id;
//        NewOrderService::inNow($p);
        NewOrderService::inQueue($p);
    }

    /**
     * 度小店应用回调地址
     * @return void
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function callback(){
        $p=$this->request->get();
        NewOrderService::callback($p);
    }
}
